-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
(wip) BUG: groupby with sort=False create buggy multiindex #32506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
95921b9
to
27e9dc6
Compare
# GH 17537 | ||
grouped = mframe.groupby(level=0, sort=sort) | ||
exp_labels = np.array(labels, np.intp) | ||
exp_labels = np.array([2, 2, 2, 0, 0, 1, 1, 3, 3, 3], np.intp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am deliberately changing the codes, so IMO it's right to change this test as well
if len(all_codes) > 1 or not isinstance( | ||
ping.grouper, (Categorical, CategoricalIndex, BinGrouper) | ||
): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel really uneasy about this special-casing, just seeing if it works
This is a tough one, I'll come back to it later |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff
Still messy, just running this through the test suite as my laptop's not great (but please let me know if such behaviour is unwelcome and I won't do it again)
pandas/tests/groupby/test_timegrouper.py
pandas/tests/groupby/test_grouping.py
pandas/tests/groupby/test_categorical.py
pandas/tests/groupby/test_groupby.py
pandas/tests/test_multilevel.py